package springbootcache.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import springbootcache.bean.Employee;
import springbootcache.service.EmployeeService;

@RestController
public class EmployeeController {

    @Autowired
    EmployeeService service;

    @GetMapping("/emp/{id}")
    public Employee getEmp(@PathVariable("id") Integer id){
         Employee employee = service.getEmp(id);
         return employee;
    }
}
